<?php
return CMap::mergeArray(
		require_once(dirname(__FILE__).'/main.php'),
		array(
			// стандартный контроллер
			'defaultController' => 'site/index',
			'params'=>array(
				'languages'=>array('en'=>'English', 'ru'=>'Русский'),
			),
			'sourceLanguage' => 'en',
			'language' => 'en',
			// компоненты
			'components'=>array(
				'messages'=>array(
					'forceTranslation'=>true,
					'onMissingTranslation' => array('CustomEventHandler', 'handleMissingTranslation'),
				),
				'request'=>array(
					'enableCookieValidation'=>true,
					'enableCsrfValidation'=>false,
				),
				'urlManager'=>array(
					'class'=>'application.components.UrlManager',
					'urlFormat'=>'path',
					'showScriptName' => false,
					'rules'=>array(
						'ulogin/login'=>'ulogin/login',
						'<language:(ru|ua|en)>/login/'=>'site/login',
						'<language:(ru|ua|en)>/logout/'=>'site/logout',
						'<language:(ru|ua|en)>/forgot/'=>'site/forgot',
						'<language:(ru|ua|en)>/search/'=>'site/search',
						'<language:(ru|ua|en)>/registration/'=>'site/registration',
						'<language:(ru|ua|en)>/favorites/'=>'favorites/index',
						'<language:(ru|ua|en)>/rooms/'=>'cataloge/index',
						'<language:(ru|ua|en)>/rooms/<id:\d+>'=>'cataloge/view',
						'<language:(ru|ua|en)>/users/cabinet/'=>'users/cabinet',
						'<language:(ru|ua|en)>/users/cabinet/accaunt/'=>'users/update',
						'<language:(ru|ua|en)>/users/cabinet/settings/'=>'users/settings',
						'<language:(ru|ua|en)>/users/cabinet/my-trips/'=>'users/trips',
						'<language:(ru|ua|en)>/users/cabinet/my-rooms/'=>'users/myObjects',
						'<language:(ru|ua|en)>/users/cabinet/upload/'=>'users/upload',
						'<language:(ru|ua|en)>/users/<id:\d+>'=>'users/view',
						'<language:(ru|ua|en)>/users/messages/'=>'users/indexMessage',
						'<language:(ru|ua|en)>/users/messages/<companion:\d+>'=>'users/viewMessage',
						'<language:(ru|ua|en)>/<alias>'=>'site/page',
						'<language:(ru|ua|en)>/'=>'site/index',
						'<language:(ru|ua|en)>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
					),
				),
				// пользователь
				'user'=>array(
					'loginUrl'=>array('/site/login'),
				),

				// mailer
				'mailer'=>array(
					'pathViews' => 'application.views.backend.email',
					'pathLayouts' => 'application.views.email.backend.layouts'
				),
					
			),
		)
);